<?php
use yii\helpers\Url;
use yii\Web\View;
use app\assets\PackListAsset;
PackListAsset::register($this);
$this->title = $this->context->pageTitle.Yii::$app->params['titleSuffix'];
$this->params['breadcrumbs'] = [
  \Yii::t('pack', 'Pack List'),
  \Yii::t('common', 'Data')
];
$jsMsgs = $this->context->loadJsMsgs([
  'table',
  'packList',
  'listOp'
]);
$this->registerJs("VAM.setVar('LANGUAGE_JS', '".$jsMsgs."');", View::POS_HEAD);
?>
<div class="page-header">
  <h1>
    <?=\Yii::t('pack', 'Pack List')?>
    <small><?=\Yii::t('common', 'Data')?></small>
    <!-- <div class="btn-group pull-right" role="group" aria-label="...">
      <a href="<?= Url::to(['black-white-list']);?>" class="btn btn-sm btn-success" data-loading-text="<i class='fa fa-spinner fa-spin'></i> 加载中..." id="new-operate-btn">
        <i class="fa fa-plus-circle"></i>
        黑白名单管理
      </a>
    </div> -->
  </h1>
</div>
<div class="panel panel-default">
  <div class="panel-heading"> 
    <i class="fa fa-table"></i>
    <?=\Yii::t('pack', 'Pack List')?>
    <ul class="list-inline list-unstyled pull-right">
      <li>
        <a class="data-table-refresh" href="#" title="<?=\Yii::t('common', 'Click to refresh data')?>">
          <i class="fa fa-refresh"></i>
        </a>
      </li>
      <li>
        <a href="#">
          <i class="fa fa-chevron-up"></i>
        </a>
      </li>
    </ul>
  </div>
  <div class="panel-body">
    <div id="list-loading-wrap" class="local-loading-wrap"></div>
    <div class="table-responsive">
      <table class="table table-hover table-striped table-bordered table-condensed" id="data-table" data-tag="vm-adserver.Pack-adspace-list">
        <thead class="heading">
          <tr>
            <th data-resizable-column-id="id" data-search="on" data-filter="on">ID</th>
            <th data-resizable-column-id="name" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Name')?></th>
            <!-- <th data-resizable-column-id="belongChannel" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Market')?></th>
            <th data-resizable-column-id="trafficType" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Traffic')?></th> -->
            <th data-resizable-column-id="size" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Size')?></th>
            <!-- <th data-resizable-column-id="floorPrice" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Floor Price')?>（￥）</th> -->
            <!-- <th data-resizable-column-id="ceilingPrice" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Ceiling Price')?>（￥）</th> -->
            <th data-resizable-column-id="allowFormat" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Format')?></th>
            <!-- <th data-resizable-column-id="systemType" data-search="on" data-filter="on"><?=\Yii::t('pack', 'System Type')?></th> -->
            <th data-resizable-column-id="position" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Form')?></th>
            <!-- <th data-resizable-column-id="price" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Price')?>(CPM/￥)</th> -->
            <th data-resizable-column-id="modifiedDate" data-search="on" data-filter="on"><?=\Yii::t('pack', 'Update Time')?></th>
          </tr>
        </thead>
        <tbody>
          <tr role="row">
            <td class="text-center dataTables_empty" colspan="6"><?=\Yii::t('site', 'No Records')?></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
<?php
  $filterStatus = $filter;
  $url = Yii::getAlias('@web') . '/response/pack/packListDataList.php';
  $urlPackInfo = Yii::getAlias('@web') . '/response/pack/packInfoDataList.php';
  $url = Url::to(['get-pack-list']);
  $urlPackInfo = Url::to(['get-pack-apps']);
  $this->registerJs("VAM.setVar('PACK_LIST_DATA_LIST', '$url')", View::POS_HEAD);
  $this->registerJs("VAM.setVar('PACK_INFO_DATA_LIST', '$urlPackInfo')", View::POS_HEAD);
  $this->registerJs("VAM.setVar('LIST_FILTER_STATUS', '$filterStatus')",View::POS_HEAD);
?>
<script type="text/javascript" >
  requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/site.js"], function(common) {
    requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/pack/packList.js"]);
  });
</script>
